Zend - unable to catch exception [closed]

Posted by coder3 on Programmers See other posts from Programmers or by coder3
Published on 2012-04-16T03:09:20Z Indexed on 2012/04/16 5:45 UTC
Read the original article Hit count: 492

Filed under:
|
|

This still throw an uncaught exception.. Any insight why this isn't working?

 protected function login()
        {
        $cart = $this->getHelper('GetCurrentCart');
        $returnValue = false;
        if ($this->view->form->isValid($this->_getAllParams())) {

        $values = $this->view->form->getValues();

        try {

        $this->goreg = $this->goregFactory->create($this->config->goreg->service_url);
        if ($this->goreg->login($values['username'], $values['password'])
                        && $this->goregSession->isLoggedIn()) {

            $returnValue = true;
        } else {
            echo 'success 1';
        }
        }
        catch (Exception $e) {
    echo 'error 1';
        }
         catch (Zend_Exception $e) {
             echo 'error 2';

        }
        catch (Zend_Http_Client_Exception $e) {
             echo 'error 3';

        }
    }

    return $returnValue;
}

© Programmers or respective owner

Related posts about php

Related posts about exceptions